#ifndef CHAT_ROOM_H
#define CHAT_ROOM_H

#include <iostream>
#include <set>
#include <list>
#include <vector>
#include <boost/weak_ptr.hpp>
#include <boost/shared_ptr.hpp>
#include <boost/bind.hpp>

#include "GameMessage.h"

class GameSession;
class GameServer;

typedef boost::shared_ptr<GameSession> chat_session_ptr;


class GameRoom
{
public:
        GameRoom(GameServer& server);

	void	join		(chat_session_ptr participant);
	void	leave		(chat_session_ptr participant);
        void	deliver_all		(const GameMessage& msg);
        void    deliver_except  (const GameMessage& msg,chat_session_ptr participant);
        std::set<chat_session_ptr>& get_participants();

private:
        void add_participants_to_game_message(GameMessage& e);
	std::set<chat_session_ptr>	m_participants;
        GameServer&				m_server;
};

typedef boost::shared_ptr<GameRoom>	chat_room_ptr;
typedef boost::weak_ptr<GameRoom>		chat_room_wptr;


#endif
